Problem: $\begin{aligned} &G(x)=\cos(3x) \\\\ &g(x)=G'(x) \end{aligned}$ $\int_{0}^{\pi} g(x)\,dx=$
$g$ is the derivative of $G$, which means $G$ is an antiderivative of $g$. Since we know the antiderivative of $g$, we can use the fundamental theorem of calculus: For every function $g$ and its antiderivative $G$, $\int_a^b g(x)\,dx=G(b)-G(a)$. $\begin{aligned} &\phantom{=}\int_{0}^{\pi} g(x)\,dx \\\\ &=G({\pi})-G({0}) \\\\ &=\cos(3{(\pi)})-\cos(3{(0)}) \\\\ &=-1-1 \\\\ &=-2 \end{aligned}$ In conclusion, $\int_{0}^{\pi} g(x)\,dx=-2$